﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 订单管理2
{
    internal class Class1
    {
        public class OrderDetails
        {
            private string _product;
            private double _cost;
            public OrderDetails(string product, double cost)
            {
                Product = product;
                Cost = cost;
            }
            public OrderDetails()
            {

            }

            public string Product
            {
                get => _product;
                set => _product = value;
            }
            public double Cost
            {
                get => _cost;
                set
                {
                    _cost = value;
                }
            }

            public double getCost()
            {
                return Cost;
            }
            public override string ToString()
            {
                return Product + "\t" + Cost + "\t" + getCost();
            }
        }
        public class Order
        {
            int _id;
            string _customer;
            OrderDetails _orderdetails;
            public Order(int id, string customer, OrderDetails orderdetail)
            {
                Id = id;
                Customer = customer;
                Orderlists = orderdetail;
            }
            public Order()
            {

            }
            public int Id { get => _id; set => _id = value; }
            public string Customer { get => _customer; set => _customer = value; }
            public OrderDetails Orderlists { get => _orderdetails; set => _orderdetails = value; }

            public override string ToString()
            {
                return Id + "\t" + Customer + "\t" + Orderlists.ToString();
            }
            public override bool Equals(Object od)
            {
                return this.Id == ((Order)od).Id;
            }
        }
        public class OrderService
        {
            List<Order> orders;

            public OrderService()
            {
                orders = new List<Order>();
            }

        }
    }
}
